package com.hsmw.schedule.utils;

import com.alibaba.fastjson.JSONObject;

import java.time.LocalDateTime;


public class ElasticSearchUtils {
    public static String esUrl ="http://123.57.32.77:9200/syslog/syslog/";

    public static void saveElasticInfo(String userId ,String description,String username) {
        long begin = System.currentTimeMillis();
        System.out.println("开始时间====" + begin);
        long time = 0;
        JSONObject param = new JSONObject();
        String id = CommonUtils.getStringRandom(12);

        param.put("createTime", LocalDateTime.now());
        param.put("description", description);
        param.put("userId", userId);
        param.put("username",username);
        String reqUrl = esUrl+id;
        try {
            System.out.println(esUrl.toString());
            String result  =new String();
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject results = new JSONObject();
    }


    public static void main(String[] args) {
        saveElasticInfo("","111","wew");


    }
}
